using AutoMapper;
using S.O.Domain.Dto.Output;
using S.O.Domain.RBAC;
using S.O.Domain.Medical;

namespace S.O.Api.Read
{
    public class RBACAutoMapper : Profile
    {
        public RBACAutoMapper()
        {
            // RBAC相关映射
            CreateMap<PermissionModel, GetPermissionListDto>();
            CreateMap<PermissionModel, PermissionDto>();
            CreateMap<UserModel, UserDto>();
            CreateMap<RoleModel, GetRoleListDto>();
            
            // 医疗相关映射
            CreateMap<PatientModel, PatientDto>()
                .ForMember(dest => dest.GenderText, opt => opt.MapFrom(src => src.Gender == 1 ? "男" : "女"));
            CreateMap<RegistrationModel, GetRegistrationListDto>();
        }
    }
}
